/* Original Author:  Dominick O'Dierno
 * Date: 2007   odiernod@gmail.com     --Originally intended for use with DOMercury:  http://www.odierno.com/domercury
 * Description: The form to modify Index item priorities
 * 
 * --CHANGELOG--
 * 
 * */
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DOMercury.Interfaces;
using DOMercury.Managers;

namespace DOMercury.Forms
{
    public partial class PriorityForm : Form
    {
        private string itemtext = "";
        private List<IItemContainer> items;
        public PriorityForm()
        {
            InitializeComponent();
            
        }

        private void btnSearch_Click(object sender, EventArgs e)
        {
            itemtext = txtSearch.Text;
            items = IndexManager.PGetItems(itemtext, nudResults.Value);
            tlpItems.Controls.Clear();
            GC.Collect();
            foreach (IItemContainer it in items)
            {
                tlpItems.Controls.Add(new PriorityContainer(it));
                //tlpItems.RowCount = tlpItems.Controls.Count;
            }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            this.Hide();
        }

    }
}